package io;

import java.io.*;

/**
 * 对象流作用：进行对象的序列化和反序列化
 */
public class OosDemo {
    public static void main(String[] args) throws IOException {
        String name = "范传奇";
        int age = 25;
        String gender = "男";
        String[] otherInfo = {"帅","技术好","玩游戏好","有钱","你们二阶段的老师"};
        Person person = new Person(name,age,gender,otherInfo);

        FileOutputStream fos = new FileOutputStream("person.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);

        oos.writeObject(person);
        System.out.println("写出完毕");
        oos.close();
    }
}
